import { IPagination } from './pagination'

interface IResultNotConfirm<T = any> {
    code: number
    result?: T
    message: string
}
interface IResultConfirm<T = any> {
    code: number
    result: T
    message: string
}

type IResult<T = any> = IResultNotConfirm<T> | IResultConfirm<T>

/**
 * @title 带有分页的接口返回值结构
 */
type IResWithPage<T = any> = IRes<IPagination<T>>

/**
 * @title 普通的接口返回值
 */
type IRes<T = any> = Promise<IResult<T>>

/**
* @title 字典表专门的响应结构 
*/
interface IDict<T = any> {
    code: string
    remark: string
    value: string
    id: string
    details: T
    type: string
}

type IResSelect<T = any> = Promise<IDict<T>[]>

export type { IResult, IRes, IResWithPage, IResultNotConfirm, IResultConfirm, IResSelect }
